package com.ydl.shopping.async;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 异步任务处理器
 */
@Component
public class AsyncTaskExecutor {
    private static final Logger log = LoggerFactory.getLogger(AsyncTaskExecutor.class);

    @Async
    public void executor(AsyncTaskConstructor asyncTaskConstructor, String taskInfo) {
        log.info("AsyncTaskExecutor正在执行异步任务: {}", taskInfo);
        asyncTaskConstructor.async();
    }
}
